You can define a Groovy-driven list of values (LOV) with a code extension of type LOV_FACTORY. The related code extension should extend AbstractExtensLovFactory and implement methods in the ELovFactory interface. For a sample code extension of this type, see Example: LOV_FACTORY (on page 1) in the N4 online help.
To implement an LOV with a code extension:
In the Code Extensions view (on page 1), write a code extension of type LOV_FACTORY.
In the Variform File Definition form (on page 1) for the variform you are overriding, in the Variform XML area, reference the code extension by including a string in the following format under the <item> element for the respective field or fields:
customCodeExtensionLov?EXTENSION=<CodeExtensionName>,KEY=<KeyName>
For example, for a code extension called custom foo lov factory that uses the keys UsersStartingWithLetterA and CountriesWithStates, the code would looks as follows:
<item fieldId="fooStaticallyDefinedDynamicComponent.fooSDCUserStartWithA">
<item-attribute type="lovKey">customCodeExtensionLov?EXTENSION=custom foo lov factory,KEY=UsersStartingWithLetterA</item-attribute>
<item-attribute type="widgetSubType">search</item-attribute>
</item>
<item fieldId="fooStaticallyDefinedDynamicComponent.fooSDCCountryCustomLov">
<item-attribute type="lovKey">customCodeExtensionLov?EXTENSION=custom foo lov factory,KEY=CountriesWithStates</item-attribute>
<item-attribute type="widgetSubType">search</item-attribute>
</item>
In the Database Backed Variforms view (on page 1), click Actions Reload All Variforms for your changes to take effect.